<div class="content">
	<?=n_mod('skin')->pageHead("站点配置", array()) ?>
	<div class="n-row n-margin-top n-margin-bottom">
		<label class="n-col-9 n-nopadding" style="text-align:center">
			当前共有<?=count($data['data'])?>条规则
		</label>
		<div class="n-col-3 n-nopadding">
			<button class="a-button-green">
				<?php
					$args = array('scode' => $data['scode'], 'pevent' => $data['pevent']);
					$url = n_url('nconfig', 'siteNew', $args);
					$text = '<i class="fa fa-plus" style="color:#fff;"></i>';
					echo n_ui($url, $text, 'style="display:block;"');
				?>
			</button>
		</div>
	</div>
	<div class="n-row n-margin-default-top n-margin-default-bottom">
		<table class="a-table a-table-striped">
			<thead>
				<tr>
					<th>模板</th>
					<th>配置名称</th>
					<th style="width:10%">操作</th>
				</tr>
			</thead>
			<tbody>
			<?php
			if (! empty($data['data'])) :
				foreach ($data['data'] as $key => $val) :
					$target = 'class="n-href" target="_self"';
					$url = n_url("nconfig", "siteEdit", array("scode" => $data['scode'], "id" => $val['id'], "pevent" => $data['pevent']));
					$edit = n_ui($url, '<i class="fa fa-cog"></i>', $target);
					$url = n_url("nconfig", "siteDel", array("id" => $val['id']));
					$remove = n_ui($url, '<i class="fa fa-remove"></i>', $target);
					$link = "$edit $remove";
			?>
				<tr>
					<td><?=$val['tname']?></td>
					<td><?=$val['title']?></td>
					<td><?=$link?></td>
				</tr>
			<?php
				endforeach;
			else :
			?>
				<tr>
					<td colspan="3">暂无配置数据</td>
				</tr>
			<?php
			endif;
			?>
			</tbody>
		</table>
	</div>
</div>
